package com.mmp.main.servlet.report;

import java.io.IOException;
import java.util.HashMap;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mmp.common.servlet.BasicServlet;
import com.mmp.main.entity.JobOrder;
import com.mmp.main.util.Default;

/**
 * Servlet implementation class ViewStandardJobOrderReport
 */
public class ViewStandardJobOrderReport extends BasicServlet {

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
			IOException {
		JobOrder jo = (JobOrder) request.getAttribute(Default.JOB_ORDER_INFO_ATTR_NAME);
		HashMap params = new HashMap();

		params.put("jobOrder", jo);
		params.put("device", jo.getHospitalDevice());
		params.put("responsibleEngineer", jo.getResponsibleEngineer());
		params.put("hospDepHead", jo.getRelatedHospitalDepartmentHead());
		params.put("siteManager", jo.getSiteManager());
		params.put("mmpDepHead", jo.getMmpDepartmentHead());
		params.put("hospAssistDir", jo.getHospitalAssistantDirector());
		params.put("hospDirector", jo.getHospitalDirector());
		viewPDFReport("JobOrderReport.jasper", null, params, request, response);
	}

}
